package com.wg.result;


import io.swagger.annotations.ApiModelProperty;

import java.util.ArrayList;
import java.util.List;

/**
 * 分页基础数据 展示封装
 * @auther QingJiang
 * @Date 2017/8/1
 */
public class BasePageData<T> {

    @ApiModelProperty("页码")
    private int pageNum; // 页码
    @ApiModelProperty("每页大小")
    private int pageSize; // 每页大小
    @ApiModelProperty("总数据量")
    private Integer totalCount; // 总数据量
    @ApiModelProperty("结果集(list对象)")
    private List<T> results; // 结果集(List对象)

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getTotalCount() {
        if (totalCount == null) {
            return 0;
        }
        return totalCount;
    }

    public void setTotalCount(Integer totalCount) {
        this.totalCount = totalCount;
    }

    public List<T> getResults() {
        if (results == null) {
            return new ArrayList<>();
        }
        return results;
    }

    public void setResults(List<T> results) {
        this.results = results;
    }
}
